ssh_list=( node-0 node-1 )
len_of_ssh=${#ssh_list[@]}
session=local-2
window1=develop
window2=control
interval_for_ssh=0.5

tmux new-session -s ${session} -n ${window1} -d
tmux new-window -t ${session} -n ${window2}

for (( i=1; i<len_of_ssh; i++ )); do
    tmux split-window -t ${session}:${window1} -p20000 -h
    tmux split-window -t ${session}:${window2} -p20000 -h
    sleep ${interval_for_ssh}
done

for (( i=0; i<len_of_ssh; i++ )); do
    j=$((i+1))
    tmux send-keys -t ${session}:${window1}.${j} "ssh ${ssh_list[i]}" C-m
    tmux send-keys -t ${session}:${window2}.${j} "ssh ${ssh_list[i]}" C-m
    sleep ${interval_for_ssh}
done

tmux select-layout -t ${session}:${window1} tiled
tmux select-layout -t ${session}:${window2} tiled
tmux set-option -t ${session}:${window1} synchronize-panes on
tmux set-option -t ${session}:${window2} synchronize-panes on
tmux select-window -t ${session}:${window1}
tmux attach -t ${session}
